Merged
Conversation
Mrtenz
commented
Nov 5, 2025
| @@ -1,5 +1,5 @@ | |||
| { | |||
| "branches": 94.87, | |||
| "branches": 94.77, | |||
Member
Author
There was a problem hiding this comment.
The ?? [] branch is not covered, but it's not easy to do without adding mock data to DYNAMIC_PERMISSION_DEPENDENCIES.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3726 +/- ##
=======================================
Coverage 98.27% 98.28%
=======================================
Files 418 418
Lines 12146 12158 +12
Branches 1875 1877 +2
=======================================
+ Hits 11937 11949 +12
Misses 209 209 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
FrederikBolding
approved these changes
Nov 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a bug where dynamic permissions would be revoked when updating a Snap. For example, if a Snap dynamically requested accounts through the
endowment:caip25permission, that permission would be deemed unused, since the Snap can't request it in the manifest.To solve it, I've added some logic that checks if dynamic permissions are present in the old permissions, checks if the desired permissions has at least one of the "dependencies" of the dynamic permission (e.g.,
endowment:caip25requiresendowment:ethereum-providerto be useful), and adds it back to the desired permissions.Note
Ensures dynamic permissions persist on Snap update when dependencies remain requested, and are revoked when none are used.
#getDesiredPermissionsto retain dynamic permissions if any dependency inDYNAMIC_PERMISSION_DEPENDENCIESis still desired.#calculatePermissionsChangeto use desired permissions including dynamic ones; adjust unused/new permissions logic.DYNAMIC_PERMISSION_DEPENDENCIESmapping (e.g.,endowment:caip25→endowment:ethereum-provider).coverage.json.Written by Cursor Bugbot for commit 0ee3f2a. This will update automatically on new commits. Configure here.